{include file="public/header" /}
<body class="gray-bg">
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>抽签</h5>
                </div>
                <div class="ibox-content layui-form">
                    <div class="layui-row layui-col-space10 layui-form-item ">

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">队名：</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" style="height: 200px" name="user" placeholder="请用英文“,”隔开"></textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">场次名称：</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" name="chang" placeholder="请用英文“,”隔开"></textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <label class="layui-form-label">结果：</label>
                            <div class="layui-input-block">
                                <textarea class="layui-textarea" style="height: 300px" id="chouq"></textarea>
                            </div>
                        </div>

                        <div class="layui-form-item layui-col-md-offset1 layui-col-md8">
                            <div class="layui-input-block">
                                <button class="layui-btn" lay-submit="" lay-filter="component-form-element">开始
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
{include file="public/footer" /}
<script>
    layui.use(['form','upload','layedit'], function() {
        var form = layui.form;
        form.on('submit(component-form-element)', function (data) {
            $.ajax({
                url:"{:url('index')}",
                type:'post',
                dataType:'json',
                data:data.field,
                success:function(res){
                    var _html = '';
                    $.each(res,function (i,d) {
                        _html += i + ':' + d;
                        _html += '\n';
                    });
                    $('#chouq').val(_html);
                }
            })
        });
    });
</script>

</body>
</html>
